package ca.concordia.soen6461.wichf.ui.web.parser;

import javax.servlet.http.HttpServletRequest;

import ca.concordia.soen6461.wichf.controller.Session;
import ca.concordia.soen6461.wichf.navigation.event.PayEvent;
import ca.concordia.soen6461.wichf.ui.web.BaseEventParser;

public class PayEventParser extends BaseEventParser<PayEvent> {

	public PayEventParser() {
		super(PayEvent.class);
	}

	@Override
	public PayEvent parse(HttpServletRequest request, Session session) {
		PayEvent event = new PayEvent(session);
		CheckoutEventParser.populateEvent(request, event);
		event.setCreditCardNumber(request.getParameter("card_no"));
		event.setNameOnCard(request.getParameter("card_name"));
		return event;
	}

}
